#!/usr/bin/python

import numpy as np
import matplotlib.pyplot as plt

from plot_data import plot_circles, get_colormap, change_tick_fontsize

def plot_vector(ax, result, idx, colormap):
    t, vector = result
    ax.set_title("t=%s" % t, fontsize=10)
    plt.scatter(np.arange(0, len(vector)), vector, s=10, c=idx, cmap=colormap,
        alpha=0.9, facecolors="none")
    change_tick_fontsize(ax, 8)

def plot_figure(points, vectors, idx):
    colormap = get_colormap()
    fig = plt.figure(figsize=(6, 5.5))

    fig.subplots_adjust(wspace=0.4, hspace=0.3)
    ax = fig.add_subplot(2, 2, 1)
    plot_circles(ax, points, idx, colormap)

    ax = fig.add_subplot(2, 2, 2)
    plot_vector(ax, vectors[0], idx, colormap)

    ax = fig.add_subplot(2, 2, 3)
    plot_vector(ax, vectors[1], idx, colormap)

    ax = fig.add_subplot(2, 2, 4)
    plot_vector(ax, vectors[2], idx, colormap)

    plt.show()
